<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head></h:head>
<body style="">

	<h:outputStylesheet>
		 .ui-panelgrid tr, td {
		border:0 !important;
		}
	</h:outputStylesheet>

	<h:form>

		<ui:fragment rendered="#{login.loggedIn==false}">
			<p:panelGrid style="margin:auto;">
				<p:row>
					<p:column colspan="2">
						<h:outputLabel value="Login " />
					</p:column>
				</p:row>
				<p:row>
					<p:column>
						<h:outputLabel value="Username" />
					</p:column>
					<p:column>
						<p:inputText value="#{login.username}" required="true" />
					</p:column>
				</p:row>
				<p:row>
					<p:column>
						<h:outputLabel for="pwd1" value="Password: *" />
					</p:column>
					<p:column>
						<p:password required="true" value="#{login.password}" />
					</p:column>
				</p:row>
				<p:row>
					<p:column colspan="2">
						<p:commandButton value="Login" action="#{login.LoginSystem()}"
							onclick="update()" />
					</p:column>
				</p:row>
			</p:panelGrid>
		</ui:fragment>
		<ui:fragment rendered="#{login.loggedIn}">
		<p:panelGrid columns="3">
			<h:outputLabel value="Ciao " />
			<h:outputLabel value="#{login.username}" />
			<p:commandButton action="#{login.Logout()}" value="Logout"
				onclick="update()" />
		</p:panelGrid>
		</ui:fragment>
	</h:form>
</body>
</html>